package com.yuma.cloud.order.feign;


import com.yuma.cloud.order.feign.callback.UserFeignClientFallBack;
import com.yuma.cloud.user.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(name = "service-user",fallback = UserFeignClientFallBack.class)
public interface UserFeignClient {
    /**
     * OpenFeign 重写了 @GetMapping  @PostMapping
     * 方向和spring mvc不一样 ，spring mvc是来接受请求的，但是OpenFeign 是发送请求
     */
    @GetMapping(value = "/api/user/findUserByUserId/{userId}")
    User findUserByUserId(@PathVariable(value = "userId") Long userId);
}
